package com.tzxs.pay.main.gather;

import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.tzxs.pay.R;
import com.tzxs.pay.databinding.ActivityUseInfoBinding;
import com.tzxs.pay.main.base.BaseActivity;
import com.tzxs.pay.util.ApiService;
import com.tzxs.pay.util.StatusBarColorSetter;

//使用说明activity
public class UserInfoActivity extends BaseActivity<ActivityUseInfoBinding> {
    @Override
    protected Activity getChildActivity() {
        return this;
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_use_info;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        StatusBarColorSetter.setStatusBarColor(this, Color.parseColor("#FAFAFA"));
        //返回
        dataBinding.useToolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                onBackPressed();
            }
        });
        dataBinding.useWeb.loadUrl(ApiService.instructions + "Instructions");
        dataBinding.useWeb.setWebChromeClient(new WebChromeClient());
        dataBinding.useWeb.setWebViewClient(new WebViewClient() {
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                view.loadUrl(url);
                return true;
            }
        });
    }
}